fix(docker): propagate OPENSHELL_IMAGE_TAG to cross-compile Dockerfiles#530
Merged
fix(docker): propagate OPENSHELL_IMAGE_TAG to cross-compile Dockerfiles#530
Conversation
Three Dockerfiles that cross-compile CLI binaries via Docker were missing
ARG OPENSHELL_IMAGE_TAG declarations. The CI workflows and build scripts
already pass this as a --build-arg, but without the ARG declaration Docker
silently drops it. This caused Rust's option_env!("OPENSHELL_IMAGE_TAG")
to resolve to None at compile time, falling back to "dev" for
DEFAULT_IMAGE_TAG in stable release binaries.
Affected artifacts:
- macOS CLI binary (Dockerfile.cli-macos)
- Linux Python wheels (Dockerfile.python-wheels)
- macOS Python wheels (Dockerfile.python-wheels-macos)
The Linux CLI binary was not affected because it builds directly in the
CI container where OPENSHELL_IMAGE_TAG is set as a real env var.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stable release binaries built via Docker cross-compilation (macOS CLI, Linux/macOS Python wheels) were baking
DEFAULT_IMAGE_TAG = "dev"instead of the release semver. This caused these binaries to pulldev-tagged Docker images instead of the version-pinned stable images.Related Issue
N/A (discovered via investigation)
Changes
ARG OPENSHELL_IMAGE_TAGtoDockerfile.cli-macos,Dockerfile.python-wheels, andDockerfile.python-wheels-macosOPENSHELL_IMAGE_TAGas a--build-arg, but without theARGdeclaration in the Dockerfile, Docker silently drops itoption_env!("OPENSHELL_IMAGE_TAG")reads the env at compile time; without theARG, it getsNoneand falls back to"dev"Root Cause
crates/openshell-bootstrap/src/image.rsdefines:Docker
ARGvalues are available as env vars duringRUNcommands, but only if declared. The three affected Dockerfiles declaredARG OPENSHELL_CARGO_VERSION(for version patching) but notARG OPENSHELL_IMAGE_TAG(for image tag baking).Affected Artifacts
cargo buildin CI container with env var setDockerfile.cli-macos(missingARG)Dockerfile.python-wheels(missingARG)Dockerfile.python-wheels-macos(missingARG)Testing
mise run pre-commitpasses (one unrelated test failure due to local port conflict)The fix is a Dockerfile-only change with no runtime code changes. Verification requires a tagged release build to confirm the baked-in tag is correct.
Checklist